const { VITE_HIDE_HOME } = import.meta.env;
const Layout = () => import("@/layout/index.vue");
import { useRoleStore } from "@/store/modules/useRoleStore";
import { RouteRecordRaw } from 'vue-router';
import { createPinia } from 'pinia';
import { storeToRefs } from "pinia";

// 手动创建 Pinia 实例
const pinia = createPinia();

// 使用 store
const roleStore = useRoleStore(pinia);

const { role } = storeToRefs(roleStore);

export default {
  path: "/",
  name: "Home",
  component: Layout,
  redirect: "/welcome",
  meta: {
    icon: "material-symbols:table-chart-view-sharp",
    title: "数据分析",
    rank: 0,
  },
  
  children: [
    {
      path: "/welcome",
      name: "Welcome",
      component: () => import("@/views/welcome/index.vue"),
      meta: {
        title: "数据分析",
        showLink: VITE_HIDE_HOME === "true" ? false : true
      }
    }
  ]
} satisfies RouteConfigsTable;
